<template>
	<div class="demo">
		<h3>学校名称:{{name}}</h3>
		<h3>学校地址:{{address}}</h3>
		<button @click="showName">点我提示学校名</button>
	</div>
</template>

<script>
	export default {
		name:'school',
		props:['getSchoolName'],
		data(){
			return {
				name:'星桥第一小学',
				address:'学成街'
			};
		},
		methods:{
			showName(){
				this.getSchoolName(this.name)
			}
		}
	};
</script>

<style scoped>
	.demo{
		background-color: orange;
	}
</style>